

import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
// import GongMess from '../views/system/GongMess.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: "/login",
    name: "login",
    meta: {
      title: "登录"
    },
    component: () => import('../views/LoginView.vue')
  },

]


export const addRoute = [
  {
    path: '/',
    name: 'home',
    meta: {
      menu: false,
      role: ['总经理', '仓库员', '销售员'],
      title: "Saas平台"
    },
    component: () => import('@/views/HomeView.vue')
  },
  {
    path: "/purchase",//一级菜单
    name: "purchase",
    component: HomeView,
    meta: {
      menu: true,//渲染为菜单
      menuTitle: "采购",
      icon: "el-icon-menu",
      role: ['总经理', '仓库员', '销售员']
    },
    children: [//二级菜单
      {
        path: "/purchase",
        name: "purchase-1",
        component: () => import('../views/IndexView.vue'),
        meta: {
          menu: true,
          menuTitle: "采购",
          icon: "el-icon-menu",
          role: ['总经理', '仓库员', '销售员']
        },
        children: [//菜单选项
          {
            path: "",
            name: 'pro',
            component: () => import('../views/procurement/ProMent.vue'),
            meta: {
              menu: true,
              menuTitle: "采购管理",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
          {
            path: "apply",
            name: 'apply',
            component: () => import('../views/procurement/ProApply.vue'),
            meta: {
              menu: true,
              menuTitle: "采购申请",
              icon: "el-icon-menu",
              role: ['总经理', '销售员']
            }
          }, {//编辑，添加同一页面
            path: "addPurchase",
            name: "addPurchase",
            component: () => import('@/views/procurement/AddPurchase.vue'),
            meta: {
              menu: false,
              menuTitle: "采购申请",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员', '销售员']
            }
          },
          {
            path: "preview",
            name: "preview",
            component: () => import('@/views/procurement/PreView.vue'),
            meta: {
              menu: false,
              menuTitle: "采购预览",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          }, {//编辑，添加同一页面
            path: "addPurchase",
            name: "addPurchase",
            component: () => import('@/views/procurement/AddPurchase.vue'),
            meta: {
              menu: false,
              menuTitle: "采购申请",
              icon: "el-icon-menu"
            }
          },
          {
            path: "preview",
            name: "preview",
            component: () => import('@/views/procurement/PreView.vue'),
            meta: {
              menu: false,
              menuTitle: "采购预览",
              icon: "el-icon-menu"
            }
          }
        ]

      },
    ]
  },
  //刘馨蔓
  {
    path: "/inventory",
    name: "inventory",
    component: HomeView,
    meta: {
      menu: true,//渲染为菜单
      menuTitle: "库存",
      icon: "el-icon-menu",
      role: ['总经理', '仓库员']
    },
    children: [
      {
        path: "/outmangement",//二级菜单
        name: "outmangement",
        component: () => import('../views/IndexView.vue'),
        meta: {
          menu: true,
          menuTitle: "出库",
          icon: "el-icon-menu",
          role: ['总经理', '仓库员']
        },
        children: [
          {
            path: "out",//
            name: "outmangement",
            component: () => import('../views/inventory/OutManagement.vue'),
            meta: {
              menu: true,
              menuTitle: "出库管理",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
          {
            path: "addoutlist",//
            name: "add",
            component: () => import('../views/inventory/AddoutList.vue'),
            meta: {
              menu: true,
              menuTitle: "添加出库单",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },

          {
            path: "inventoryviewout",//
            name: "view",
            component: () => import('../views/inventory/ViewDetailsOut.vue'),
            meta: {
              menu: false,
              menuTitle: "出库预览",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },


        ]
      },
      {
        path: "/inmangement",//二级菜单
        name: "inmangement",
        component: () => import('../views/IndexView.vue'),
        meta: {
          menu: true,
          menuTitle: "入库",
          icon: "el-icon-menu",
          role: ['总经理', '仓库员']
        },
        children: [
          {
            path: "in",
            name: "inmangement",
            component: () => import('../views/inventory/InManagement.vue'),
            meta: {
              menu: true,
              menuTitle: "入库管理",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
          {
            path: "inventoryviewin",//
            name: "view",
            component: () => import('../views/inventory/ViewDetailsIn.vue'),
            meta: {
              menu: false,
              menuTitle: "入库预览",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
          {
            path: "addinlist",//
            name: "add",
            component: () => import('../views/inventory/AddinList.vue'),
            meta: {
              menu: true,
              menuTitle: "添加入库",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
        ]
      },
    ]

  },
  //邹杰
  {
    path: "/xiaoshou",//一级菜单
    name: "xiaoshou",
    component: HomeView,
    meta: {
      menu: true,//渲染为菜单
      menuTitle: "销售",
      icon: "el-icon-menu",
      role: ['总经理', '销售员']
    },
    children: [//二级菜单
      {
        path: "/dingdan",
        name: "/dingdan",
        component: () => import('../views/IndexView.vue'),
        meta: {
          menu: true,
          menuTitle: "订单管理",
          icon: "el-icon-menu",
          role: ['总经理', '销售员']
        },
        children: [//菜单选项
          {
            path: "dingdan-list",
            name: 'dingdan-list',
            component: () => import('../views/zone/XiaoShouList.vue'),
            meta: {
              menu: true,
              menuTitle: "订单列表",
              icon: "el-icon-menu",
              role: ['总经理', '销售员']
            }
          },
          {
            path: "add-list",
            name: 'add-list',
            component: () => import('../views/zone/DinDanList.vue'),
            meta: {
              menu: true,
              menuTitle: "添加订单",
              icon: "el-icon-menu",
              role: ['总经理', '销售员']
            }
          },
          {
            path: "list",
            name: 'list',
            component: () => import('../views/zone/PuTong.vue'),
            meta: {
              menu: false,
              menuTitle: "查看订单",
              icon: "el-icon-menu",
              role: ['总经理', '销售员']
            }
          },
        ]

      },
    ]
  },
  //董彦宇
  {
    path: "/Xingwei",//一级菜单
    name: "Xingwei",
    component: HomeView,
    meta: {
      menu: true,//渲染为菜单
      menuTitle: "行为",
      icon: "el-icon-menu",
      role: ['总经理', '仓库员', '销售员']
    },
    children: [
      {
        path: "/Xingwei-1",//二级菜单
        name: "Xingwei-1",
        component: () => import('../views/IndexView.vue'),
        meta: {
          menu: true,
          menuTitle: "路线管理",
          icon: "el-icon-menu",
          role: ['总经理', '销售员']
        },
        children: [
          {
            path: "Xingwei-1-1",//菜单选项
            name: 'Xingwei-1-1',
            component: () => import('../views/xingwei/luxian/XingWei.vue'),
            meta: {
              menu: true,
              menuTitle: "路线管理",
              icon: "el-icon-menu",
              role: ['总经理', '销售员']
            }
          },
          {
            path: "Xingwei-1-2",
            name: 'Xingwei-1-2',
            component: () => import('../views/xingwei/luxian/DindanList.vue'),
            meta: {
              menu: true,
              menuTitle: "添加路线",
              icon: "el-icon-menu",
              role: ['总经理', '销售员']
            }
          },
          {
            path: "purchase-1-3",
            name: 'purchase-1-3',
            component: () => import('../views/xingwei/luxian/BaiJie.vue'),
            meta: {
              menu: true,
              menuTitle: "拜访结果查询",
              icon: "el-icon-menu",
              role: ['总经理', '销售员']
            }
          },
          {
            path: "Xingwei-1-4",
            name: 'Xingwei-1-4',
            component: () => import('../views/xingwei/luxian/BaiTong.vue'),
            meta: {
              menu: true,
              menuTitle: "拜访统计",
              icon: "el-icon-menu",
              role: ['总经理', '销售员']
            }
          },
          {
            path: "Xingwei-1-5",
            name: 'Xingwei-1-5',
            component: () => import('../views/xingwei/luxian/ShangChuan.vue'),
            meta: {
              menu: true,
              menuTitle: "上传信息系统",
              icon: "el-icon-menu",
              role: ['总经理', '销售员']
            }
          },

        ]
      },
      {
        path: "/Xingwei-2",//二级菜单
        name: "Xingwei-2",
        component: () => import('../views/IndexView.vue'),
        meta: {
          menu: true,
          menuTitle: "销售管理",
          icon: "el-icon-menu",
          role: ['总经理', '仓库员']
        },
        children: [
          {
            path: "Xingwei-1-3",
            name: 'Xingwei-1-3',
            component: () => import('../views/xingwei/xiaoshou/RenXiao.vue'),

            meta: {
              menu: true,
              menuTitle: "人员销售动态",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
          {
            path: "XiaoShou-1-4",
            name: 'Xiaoshou-1-4',
            component: () => import('../views/xingwei/xiaoshou/ShangXiao.vue'),
            meta: {
              menu: true,
              menuTitle: "商品销售动态",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
          {
            path: "XiaoShou-1-5",
            name: 'Xiaoshou-1-5',
            component: () => import('../views/xingwei/xiaoshou/MenXiao.vue'),
            meta: {
              menu: true,
              menuTitle: "门店销售动态",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
        ]
      }
    ]
  },
  {
    path: "/system",//一级菜单
    name: "system",
    component: HomeView,
    meta: {
      menu: true,//渲染为菜单
      menuTitle: "系统",
      icon: "el-icon-menu",
      role: ['总经理', '仓库员']
    },
    children: [//二级菜单
      //徐彬鑫
      {
        path: "/xitong-1",//二级菜单
        name: "xitong-1",
        component: () => import('../views/IndexView.vue'),
        meta: {
          menu: true,
          menuTitle: "基本资料",
          icon: "el-icon-menu",
          role: ['总经理', '仓库员']
        },
        children: [
          {
            path: 'xinxi',
            name: 'xinxi',
            component: () => import('../views/system/GongMess.vue'),
            meta: {
              menu: true,
              menuTitle: '公司信息',
              icon: 'el-icon-menu',
              role: ['总经理']
            }
          },
          {
            path: "bumen",
            name: 'bumen',
            component: () => import('../views/system/BumenMent.vue'),
            meta: {
              menu: true,
              menuTitle: "部门管理",
              icon: "el-icon-menu",
              role: ['总经理']
            }
          },
          {
            path: "purchase-1-3",
            name: 'purchase-1-3',
            component: () => import('@/views/system/basic/PositionView'),
            meta: {
              menu: true,
              menuTitle: "职位管理",
              icon: "el-icon-menu",
              role: ['总经理']
            }
          },
          {
            path: "permission",
            name: 'permission',
            component: () => import('../views/system/basic/PermissionsView'),
            meta: {
              menu: false,
              menuTitle: "权限设置",
              icon: "el-icon-menu",
              role: ['总经理']
            }
          },
          {
            path: "yuangong",
            name: 'yuangong',
            component: () => import('../views/system/YuanMess.vue'),
            meta: {
              menu: true,
              menuTitle: "员工管理",
              icon: "el-icon-menu",
              role: ['总经理']
            }
          },
          //邹杰
          {
            path: "store",//菜单选项
            name: 'store',
            component: () => import('../views/system/ziliao/CangKu.vue'),
            meta: {
              menu: true,
              menuTitle: "仓库管理",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
          {
            path: "unit",
            name: 'unit',
            component: () => import('../views/system/ziliao/JiLiang.vue'),
            meta: {
              menu: true,
              menuTitle: "计量单位",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
          {
            path: "operation",
            name: 'operation',
            component: () => import('../views/system/ziliao/RiZhi.vue'),
            meta: {
              menu: true,
              menuTitle: "操作日志",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
          {
            path: "addyuan",
            name: "addyuan",
            component: () => import('../views/system/AddYuan.vue'),
            meta: {
              menu: false,
              menuTitle: "添加员工",
              role: ['总经理']
            }
          },
        ]
      },
      //陈芬
      {
        path: "/goods",//二级菜单
        name: "goods",
        component: () => import('../views/IndexView.vue'),
        meta: {
          menu: true,
          menuTitle: "商品管理",
          icon: "el-icon-menu",
          role: ['总经理', '仓库员']
        },
        children: [
          {
            path: "brand",//菜单选项
            name: 'brand',
            component: () => import('../views/system/commodity-management/BrandView.vue'),
            meta: {
              menu: true,
              menuTitle: "品牌管理",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
          {
            path: "classifity",
            name: 'classifity',
            component: () => import('../views/system/commodity-management/ClassifityView.vue'),
            meta: {
              menu: true,
              menuTitle: "商品分类-一级",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
          {
            path: "information",
            name: 'Information',
            component: () => import('../views/system/commodity-management/InformationView.vue'),
            meta: {
              menu: true,
              menuTitle: "商品信息维护",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
          {
            path: "top",
            name: 'top',
            component: () => import('../views/system/commodity-management/TopView.vue'),
            meta: {
              menu: true,
              menuTitle: "商品置顶",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
          {
            path: "addGoods",
            name: 'addGoods',
            component: () => import('../views/system/commodity-management/AddClassify.vue'),
            meta: {
              menu: false,
              menuTitle: "添加商品",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
          {
            path: 'addBrand',
            name: 'addBrand',
            component: () => import('../views/system/commodity-management/BrandNew.vue'),
            meta: {
              menu: false,
              menuTitle: "添加新内容",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
          {
            path: 'TwoEdit',
            name: 'TwoEdit',
            component: () => import('../views/system/commodity-management/TwoEdit.vue'),
            meta: {
              menu: false,
              menuTitle: "编辑内容",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
          {
            path: 'addTwo',
            name: 'addTwo',
            component: () => import('../views/system/commodity-management/AddTwo.vue'),
            meta: {
              menu: false,
              menuTitle: "新增内容",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
          {
            path: 'addClassify',
            name: 'addClassify',
            component: () => import('../views/system/commodity-management/AddClassify.vue'),
            meta: {
              menu: false,
              menuTitle: "新增下级",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
          {
            path: 'lookSubordinate',
            name: 'lookSubordinate',
            component: () => import('../views/system/commodity-management/LookSubordinate.vue'),
            meta: {
              menu: false,
              menuTitle: "商品分类-二级",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
          {
            path: 'three',
            name: 'three',
            component: () => import('../views/system/commodity-management/ThreeLevel.vue'),
            meta: {
              menu: false,
              menuTitle: "商品分类-三级",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
          {
            path: 'informationAdd',
            name: 'informationAdd',
            component: () => import('@/views/system/commodity-management/GoodsView.vue'),
            meta: {
              menu: false,
              menuTitle: "商品信息添加",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
          {
            path: "editGoods",
            name: 'editGoods',
            component: () => import('../views/system/commodity-management/EditInformation.vue'),
            meta: {
              menu: false,
              menuTitle: "编辑商品",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            }
          },
        ],
      },
      // 张浩
      {
        path: "/system-2", //二级菜单
        name: "system-2",
        component: () => import('../views/IndexView.vue'),
        meta: {
          menu: true,
          menuTitle: "客户管理",
          icon: "el-icon-menu",
          role: ['总经理', '销售员']
        },
        children: [
          {
            path: "system-2-1", //菜单选项
            name: 'system-2-1',
            component: () => import('../views/system/MerchantManagement/CustomerManagement.vue'),
            meta: {
              menu: true,
              menuTitle: "客户信息",
              icon: "el-icon-menu",
              role: ['总经理', '销售员']
            },
          },
          {
            path: "system-2-2",
            name: 'system-2-2',
            component: () => import('../views/system/MerchantManagement/CustomerType.vue'),
            meta: {
              menu: true,
              menuTitle: "客户类型",
              icon: "el-icon-menu",
              role: ['总经理', '销售员']
            }
          },
          {
            path: "system-2-3",
            name: 'system-2-3',

            meta: {
              menu: true,
              menuTitle: "客户区域",
              icon: "el-icon-menu",
              role: ['总经理', '销售员']
            }
          },
          {
            path: "system-2-4",
            name: 'system-2-4',
            component: () => import('../views/system/MerchantManagement/SuppLiers.vue'),
            meta: {
              menu: true,
              menuTitle: "供货厂商",
              icon: "el-icon-menu",
              role: ['总经理', '销售员']
            }
          },
          {
            path: "system-2-1-1",
            name: "system-2-1-1",
            component: () => import('../views/system/MerchantManagement/AddCustomer.vue'),
            meta: {
              menu: false,
              menuTitle: "添加客户",
              role: ['总经理', '销售员']
            },
          },
          {
            path: "system-2-4-1",
            name: "system-2-4-1",
            component: () => import('../views/system/MerchantManagement/AddVendors.vue'),
            meta: {
              menu: false,
              menuTitle: "添加供货厂商",
              role: ['总经理', '销售员']
            },
          },
        ]
      },
      // 王冰
      {
        path: "/system",
        name: "system-1",
        component: () => import('../views/IndexView.vue'),
        meta: {
          menu: true,
          menuTitle: "价格体系",
          icon: "el-icon-menu",
          role: ['总经理', '仓库员']
        },
        children: [//menu:true 菜单选项
          {
            path: "system-1-1",
            name: 'system-1-1',
            component: () => import('../views/system/price/PriceView.vue'),
            meta: {
              menu: true,
              menuTitle: "价格体系设置",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            },
          },
          {
            path: "cust",
            name: 'cust',
            meta: {
              menu: false,
              menuTitle: "客户类型和价格体系",
              icon: "el-icon-menu",
              role: ['总经理', '仓库员']
            },
            component: () => import('../views/system/price/CustomerView.vue'),
          }
        ]
      },
    ]
  },
]



const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
